#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "BitWidget.h"
#include "ItemWidget.h"
#include "TcpClient.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

typedef  struct
{
    QString strName;
    int size;
} Element_ST;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void customUI();

private slots:
    void itemchangedHandler(int,quint64);
    void assitantHandler(bool);
private:
    void inifileoperate(const QString& filename);
    void xmlfileoperate(const QString& filename);
    void dbfileoperate(const QString& filename);
    void updateUi();
    void readconfig();
    Ui::MainWindow *ui;
    //BitWidget *bitwidget;
    ItemWidget* Item;
    TcpClient* client;

    QWidget* mainWidget;
    QVector<Element_ST> vetElements;
    QVector<ItemWidget*> vetItems;
    QWidget* loadWidget;

    QStringList slConfigInfo;
    QStringList slMsgFrames;
};
#endif // MAINWINDOW_H
